#include<cstdio>//uncle-lu

int main()
{
	double x, sum, fact;
	int n;
	scanf("%lf%d",&x,&n);

	sum = 1;
	fact = 1;

	for(int i=1; i<=n; ++i)
	{
		fact = fact * x;
		sum = sum + fact;
	}

	printf("%.2lf", sum);

	return 0;
}
